/*
 * Copyright (C), 2002-2017, 苏宁易购电子商务有限公司
 * FileName: ExchangeOrderDaoImpl
 * Author:   15030469 胡丹
 * Date:     2017/5/3 10:00
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.suning.sawp.service.impl.dao.exchange;

import com.suning.framework.dal.client.DalClient;
import com.suning.sawp.intf.dao.exchange.ExchangeOrderDao;
import com.suning.sawp.po.exchange.ExchangeOrder;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * 〈发券会员订单 dao 实现类〉<br>
 *
 * @author 15030469 胡丹
 */
@Repository
public class ExchangeOrderDaoImpl implements ExchangeOrderDao {

    @Resource(name = "dalClient")
    private DalClient dalClient;
    @Resource(name = "dalClientRead")
    private DalClient dalClientRead;

    @Override
    public ExchangeOrder selectOrder(String orderNo) {
        ExchangeOrder exchangeOrder = new ExchangeOrder();
        exchangeOrder.setOrderNo(orderNo);

        return dalClientRead.find(ExchangeOrder.class, exchangeOrder);
    }

    @Override
    public void saveOrder(ExchangeOrder exchangeOrder) {
        dalClient.persist(exchangeOrder, String.class);
    }
}
